package com.kiven.thread;

class T extends Thread {
	private int index = 0;
	
	@Override
	public void run() {
		System.out.println(++index);
	}
}

class R implements Runnable {
	private int index = 0;
	@Override
	public void run() {
		System.out.println(++index);
	}
	
}

public class ThreadTest{
	public static void main(String[] args) throws Exception {
		for(int i=0; i<5; i++) {
			Thread t1 = new T();
			t1.start();
		}
		
		Thread.sleep(10000);
		
		R r = new R();
		for(int i=0; i<5; i++) {
			Thread t2 = new Thread(r);
			t2.start();
		}
	}
}
